﻿using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.Report.PlugIn;
using Kingdee.BOS.Core.Report.PlugIn.Args;
using Kingdee.BOS.Core.Util;
using Kingdee.BOS.Util;
using Kingdee.K3.Core.Mobile.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RK.FormPlugin.Ronma
{
    [Description("Ronma:采购件库存报表颜色,编码"), HotUpdate]
    public class SetPurInvReportColor : AbstractSysReportPlugIn
    {
        public override void FormatCellValue(FormatCellValueArgs args)
        {
            //base.FormatCellValue(args);
            if (args.Header.Key.Equals("FMatName", StringComparison.OrdinalIgnoreCase))
            {
                //args.FormateValue = args.FormateValue.GetNoZeroString();
                //args.FormateValue = args.FormateValue.GetFirstPinYinLetter();
                args.FormateValue = args.FormateValue.ToUTF8String();
            }
        }
        //public override void OnFormatRowConditions(ReportFormatConditionArgs args)
        //{
        //    base.OnFormatRowConditions(args);
        //    var invQty = Convert.ToDecimal(args.DataRow["FBASEQTY"]);
        //    var safeQty = Convert.ToDecimal(args.DataRow["FSAFESTOCK"]);
        //    //库存数量低于安全库存时，行背景颜色为红色,简单账表可以BOS设置列表格式无须代码开发
        //    if (invQty < safeQty)
        //    {
        //        FormatCondition hj = new FormatCondition()
        //        {
        //            BackColor = "#FF69B4"
        //        };
        //        args.FormatConditions.Add(hj);
        //    }
        //}
    }
}
